import React from 'react'
import ArticlePreview from './ArticlePreview'

function ArticleList({ articles = [] }) {
  if (articles.length === 0) {
    return <div className="article-preview">
      No articles are here... yet.
    </div>
  }
  return (
    articles.map((article, index) => {
      return <ArticlePreview article={article} key={index} />
    })
  )
}

export default ArticleList